package com.iuie.ns.devtools.element;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class ResultMapDeleteElement extends ResultMapOperationElement {
	
	public static final Map<String, String> COMMENTS = new HashMap<String, String>() {

		private static final long serialVersionUID = -7588679128347639307L;

		{
			put("deleteById", "删除单条记录");
			put("batchDelete", "批量删除");
		}
	};

	@Override
	protected String getPrefix() {
		StringBuilder sb = new StringBuilder(12);
		sb.append("\n\t<!-- ")
			.append(COMMENTS.get(this.getOperation()))
			.append(" -->")
			.append("\n\t<delete ")
			.append("id=\"")
			.append(this.getOperation())
			.append("\"")
			.append(">\n");
		return sb.toString();
	}

	@Override
	protected String getSuffix() {
		return "\n\t</delete>\n";
	}

	@Override
	protected List<DevElement> getChildren() {
		List<DevElement> list = new ArrayList<>(1);
		list.add(new SQLDeleteElement(this));
		return list;
	}

}
